Shader "ProCamera2D/TransitionsFX/Shutters"
{
  Properties
  {
    _MainTex ("Base (RGB)", 2D) = "white" {}
    _Step ("Step", Range(0, 1)) = 0
    _BackgroundColor ("Background Color", Color) = (0,0,0,1)
    _Direction ("Direction", float) = 0
  }
  SubShader
  {
    Tags
    { 
    }
    Pass // ind: 1, name: 
    {
      Tags
      { 
      }
      ZTest Always
      ZWrite Off
      Cull Off
      Fog
      { 
        Mode  Off
      } 
      // m_ProgramMask = 6
      CGPROGRAM
      //#pragma target 4.0
      
      #pragma vertex vert
      #pragma fragment frag
      
      #include "UnityCG.cginc"
      
      
      #define CODE_BLOCK_VERTEX
      //uniform float4x4 unity_ObjectToWorld;
      //uniform float4x4 unity_MatrixVP;
      uniform float _Step;
      uniform float4 _BackgroundColor;
      uniform int _Direction;
      uniform sampler2D _MainTex;
      struct appdata_t
      {
          float4 vertex :POSITION0;
          float2 texcoord :TEXCOORD0;
      };
      
      struct OUT_Data_Vert
      {
          float2 texcoord :TEXCOORD0;
          float4 vertex :SV_POSITION;
      };
      
      struct v2f
      {
          float2 texcoord :TEXCOORD0;
      };
      
      struct OUT_Data_Frag
      {
          float4 color :SV_Target0;
      };
      
      float4 u_xlat0;
      float4 u_xlat1;
      OUT_Data_Vert vert(appdata_t in_v)
      {
          OUT_Data_Vert out_v;
          out_v.vertex = UnityObjectToClipPos(in_v.vertex);
          out_v.texcoord.xy = in_v.texcoord.xy;
          return out_v;
      }
      
      #define CODE_BLOCK_FRAGMENT
      int u_xlatb0;
      float u_xlat1_d;
      int u_xlatb1;
      float u_xlat2;
      int u_xlatb2;
      int u_xlatb3;
      OUT_Data_Frag frag(v2f in_f)
      {
          OUT_Data_Frag out_f;
          u_xlatb0 = (_Direction==0);
          u_xlat1_d = (_Step * 0.5);
          u_xlatb2 = (u_xlat1_d<in_f.texcoord.x);
          u_xlatb0 = (u_xlatb2 && u_xlatb0);
          u_xlat2 = (((-_Step) * 0.5) + 1);
          u_xlatb3 = (in_f.texcoord.x<u_xlat2);
          u_xlatb0 = (u_xlatb3 && u_xlatb0);
          if(u_xlatb0)
          {
              out_f.color = tex2D(_MainTex, in_f.texcoord.xy);
          }
          else
          {
              u_xlatb0 = (_Direction==1);
              u_xlatb1 = (u_xlat1_d<in_f.texcoord.y);
              u_xlatb0 = (u_xlatb1 && u_xlatb0);
              u_xlatb1 = (in_f.texcoord.y<u_xlat2);
              u_xlatb0 = (u_xlatb1 && u_xlatb0);
              if(u_xlatb0)
              {
                  out_f.color = tex2D(_MainTex, in_f.texcoord.xy);
              }
              else
              {
                  out_f.color = _BackgroundColor;
              }
          }
          return out_f;
      }
      
      
      ENDCG
      
    } // end phase
  }
  FallBack Off
}
